package com.lanou3g.demo.db;

import org.apache.commons.dbutils.ResultSetHandler;

import java.sql.ResultSet;
import java.sql.SQLException;

public class KeyGenerateHandler implements ResultSetHandler<Long> {
    @Override
    public Long handle(ResultSet rs) throws SQLException {
        if (rs.next()) {
            return rs.getLong(1);
        } else {
            return null;
        }
    }
}
